<form-item label="商品类型" prop="goods_type">
    <radio-group v-model="formValidate.goods_type"  button-style="solid">
        <template v-for="(items, index) in goodsTypeItems">
            <radio :label="items.value" :value="items.value" :key="items.value" border>{{items.label}}</radio>
        </template>
    </radio-group>
</form-item>
<form-item label="优惠劵" prop="reward_coupons_id" v-if="formValidate.goods_type == 1">
    <template v-if="formValidate.reward_coupons_id.length > 0">
        <tag color="primary" v-for="(items, index) in formValidate.reward_coupons_id" :key="index" closable @on-close="participationRulesCouponsRemoveEvent(index, 'reward_coupons_id')" size="large">{{items.name}}</tag>
    </template>
    <i-button @click="participationRulesSelectDiscountCouponsClickEvent('reward_coupons_id')">选择优惠劵</i-button>
    <span class="_forms-tips"><icon type="md-alert"></icon>用户完成任务后奖励的优惠劵</span>
</form-item>
<form-item label="商品名称" prop="name" >
    <i-input v-model="formValidate.name" placeholder="请输入商品名称" clearable style="width: 640px">  </i-input>
</form-item>
<form-item label="商品分类" prop="category_id">
    <i-select v-model="formValidate.category_id" placeholder="请选择商品分类" filterable style="width: 640px">
        <i-option v-for="(items, index) in goodsCategoryItems" :value="items.value" :key="items.value">{{ items.label }}</i-option>
    </i-select>
</form-item>

<form-item label="商品封面" prop="cover" >
    <div class="demo-upload-list" v-if="formValidate.cover">
        <image :src="formValidate.cover" fit="cover" width="100%" height="100%"></image>
        <div class="demo-upload-list-cover">
            <!--                            <icon type="ios-eye-outline" ></icon>-->
            <icon type="ios-trash-outline" @click="imageRemoveClickEvent('cover')"></icon>
        </div>
    </div>
    {include file='marketing/_common/upload' success="coverSuccess" model="cover" /}
</form-item>
<form-item label="商品轮播图" prop="banner" v-if="formValidate.goods_type > 2">
    <div class="demo-upload-list" v-if="formValidate.banner" v-for="(item, index) in formValidate.banner">
        <image :src="item" fit="cover" width="100%" height="100%"></image>
        <div class="demo-upload-list-cover">
            <icon type="ios-trash-outline" @click="imageRemoveClickEvent('banner', index)"></icon>
        </div>
    </div>
    {include file='marketing/_common/upload' success="bannerSuccess" model="banner" /}
</form-item>
<form-item label="商品简介" prop="introduce" >
    <i-input v-model="formValidate.introduce" type="textarea" placeholder="请输入商品简介" clearable style="width: 640px">  </i-input>
</form-item>
<!--<form-item label="商品关键字" prop="keyword" required>-->
<!--    <i-input v-model="formValidate.keyword" placeholder="请输入商品关键字" clearable style="width: 640px">  </i-input>-->
<!--</form-item>-->
<!--<form-item label="商品简介" prop="introduce" required>-->
<!--    <i-input v-model="formValidate.introduce" type="textarea" placeholder="请输入商品简介" clearable style="width: 640px">  </i-input>-->
<!--</form-item>-->
<form-item label="商品库存" prop="stock">
    <input-number :min="1" v-model.number="formValidate.stock" placeholder="请输入商品库存" style="width: 280px"></input-number>
</form-item>
<form-item label="商品销售价" prop="sales_price">
    <input-number :min="1" v-model.number="formValidate.sales_price" placeholder="请输入商品销售价" style="width: 280px"></input-number>
</form-item>
<form-item label="商品市场价" prop="market_price" >
    <input-number :min="1" v-model.number="formValidate.market_price" placeholder="请输入商品市场售价" style="width: 280px"></input-number>
</form-item>

<form-item label="兑换类型" prop="payment_type">
    <radio-group v-model="formValidate.payment_type" button-style="solid">
        <template v-for="(items, index) in paymentTypeItems">
            <radio :label="items.value" :value="items.value" :key="items.value" border>{{items.label}}</radio>
        </template>
    </radio-group>
</form-item>
<div class="forms-inline">
    <form-item label="积分数量" prop="point_amount" v-if="formValidate.payment_type == 1 || formValidate.payment_type == 3">
        <input-number :min="1" v-model.number="formValidate.point_amount" placeholder="请输入积分数量" style="width: 280px"></input-number>
    </form-item>
    <form-item label="青年币数量" prop="youth_amount" v-if="formValidate.payment_type == 2 || formValidate.payment_type == 4">
        <input-number :min="1" v-model.number="formValidate.youth_amount" placeholder="请输入青年币数量" style="width: 280px"></input-number>
    </form-item>
    <form-item label="现金金额" prop="purchase_amount" v-if="formValidate.payment_type >= 3">
        <input-number :min="1" v-model.number="formValidate.purchase_amount" placeholder="请输入现金金额" style="width: 280px"></input-number>
    </form-item>
</div>
<form-item label="用户兑换次数限制" prop="people_exchange_stated">
    <radio-group v-model="formValidate.people_exchange_stated"  button-style="solid">
        <radio :value="2" :key="2" :label="2" border>不限兑换次数</radio>
        <radio :value="1" :key="1" :label="1" border>限制兑换次数</radio>
    </radio-group>
    <span v-if="formValidate.people_exchange_stated == 1">
        每人可兑换 <input-number :min="1" v-model.number="formValidate.people_exchange_num" placeholder="几" style="width: 80px"></input-number> 次
    </span>
</form-item>

<form-item label="用户兑换时间限制" prop="date_exchange_stated">
    <radio-group v-model="formValidate.date_exchange_stated"  button-style="solid">
        <radio :value="2" :key="2" :label="2" border>不限兑换时间</radio>
        <radio :value="1" :key="1" :label="1" border>限制兑换时间</radio>
    </radio-group>
    <span v-if="formValidate.date_exchange_stated == 1">
        每 <input-number :min="1" v-model.number="formValidate.date_exchange_days" placeholder="多少天" style="width: 80px"></input-number>
        天可兑换 1 次
    </span>
</form-item>
<form-item label="兑换说明" prop="describe" >
    <quill-editor ref="myQuillDescribeEditor" :options="editorOption" v-model="formValidate.describe" style="height: 240px; box-sizing: content-box"></quill-editor>
    <upload  v-show="false"
             ref="QuillDescribeEditorUploadRef"
             :on-success="QuillDescribeEditorUploadSuccess"
             :format="['jpg','jpeg','png']"
             :max-size="5120"
             :on-progress="uploadProgressEvent"
             :on-exceeded-size="uploadExceededSizeEvent"
             :on-format-error="uploadFormatErrorEvent"
             action="/admin.php/ajax/upload?model=[model]">
        <i-button id="QuillDescribeEditorUploadButton">点击上传</i-button>
    </upload>
</form-item>
<form-item label="商品状态" prop="status">
    <radio-group v-model="formValidate.status"  button-style="solid">
        <radio :label="1" :value="1" :key="1" border >立即上架</radio>
        <radio :label="2" :value="2" :key="2" border >定时上架</radio>
        <radio :label="3" :value="3" :key="3" border >放入仓库</radio>
    </radio-group>
</form-item>
<form-item label="上架时间" prop="listing_time" v-if="formValidate.status == 2">
    <date-picker type="datetime" format="yyyy-MM-dd HH:mm" placement="bottom-end" placeholder="请选择上架时间" v-model="formValidate.listing_time"></date-picker>
</form-item>


<!--<form-item label="定时下架" prop="scheduled_off">-->
<!--    <i-switch size="large" v-model="formValidate.scheduled_off" :true-value="1" :false-value="2">-->
<!--        <span slot="open">开启</span>-->
<!--        <span slot="close">关闭</span>-->
<!--    </i-switch>-->
<!--</form-item>-->
<!--<form-item label="下架时间" prop="scheduled_time" v-if="formValidate.scheduled_off == 1">-->
<!--    <date-picker type="datetime" format="yyyy-MM-dd HH:mm" placement="bottom-end" placeholder="请选择下架时间" v-model="formValidate.scheduled_time"></date-picker>-->
<!--</form-item>-->